import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus' // 引入element-plus组件库
import 'element-plus/dist/index.css' // 引入组件库样式
import zhCn from 'element-plus/es/locale/lang/zh-cn' // 引入中文包
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App) // 应用实例赋值给全局变量

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// app.use(ElementPlus) 
app.use(ElementPlus, {  // 注册组件库
    locale: zhCn,
})
app.use(store).use(router).mount('#app')

window.ResizeObserver = class _NewResizeObserver extends ResizeObserver {
    constructor(callback) {
        super(() => window.requestAnimationFrame(() => callback.apply(this, arguments)));
    }
}